package com.spring.takeaway.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.spring.takeaway.po.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author LCD
 * @Date 2022/6/14 21:58
 **/
@Mapper
public interface OrderDao extends BaseMapper<Order> {

    @Insert("INSERT INTO `order` (phone, `name`, address, food, `status`, isdelete,sum,merimg,mername,snumber ) VALUES (#{phone}, #{name}, #{address}, #{food}, #{status}, #{isdelete},#{sum},#{merimg},#{mername},#{snumber} )")
    public int insertOrder(Order order);

    @Select("Select * from `order` where phone = #{phone} and  isdelete =0 ")
    public List<Order> getOrderList(@Param("phone") String phone);
}
